<!DOCTYPE html>
<!--[if IE 7 ]>    <html class="ie7 oldie"> <![endif]-->
<!--[if IE 8 ]>    <html class="ie8 oldie"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html> <!--<![endif]-->

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <meta name="description" content="">
    <meta name="author" content="">
	<meta property="wb:webmaster" content="3caf5a5b94e6991e" />
	<link rel="shortcut icon" href="/static/blog/coolblue/images/chine.ico"/>
	<title> {{ article.title }} | 马孔多的博客</title>
	<link type="text/css" rel="stylesheet" href="/static/blog/coolblue/css/SyntaxHighlighter/shCoreEclipse.css"><link>
	<link type="text/css" rel="stylesheet" href="/static/blog/coolblue/css/jquery.fancybox.css"><link>
	<link type="text/css" rel="stylesheet" href="/static/blog/coolblue/css/bootstrap.min.css"><link>
	<link rel="stylesheet" type="text/css" media="screen" href="/static/blog/coolblue/css/coolblue.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="/static/blog/coolblue/css/chine.css" />
	<script src="/static/blog/coolblue/js/jquery-1.7.2.min.js"></script>
	<script src="/static/blog/coolblue/js/scrollToTop.js"></script>
	<script src="/static/blog/coolblue/js/inputFocusOrBlur.js"></script>
	<script src="/static/blog/coolblue/js/jquery.form.js"></script>
	<script src="/static/blog/coolblue/js/bootstrap-transition.js"></script>
	<script src="/static/blog/coolblue/js/bootstrap-tooltip.js"></script>
	<script src="/static/blog/coolblue/js/bootstrap-modal.js"></script>
	<script src="/static/blog/coolblue/js/subscribe.js"></script>

	<!--[if lt IE 9]>
	    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->


	<script language="JavaScript" src="/static/blog/coolblue/js/SyntaxHighlighter/shCore.js"></script>
	<script language="JavaScript" src="/static/blog/coolblue/js/SyntaxHighlighter/shAutoloader.js"></script>
	<script language="JavaScript" src="/static/blog/coolblue/js/loadSyntaxHighlighter.js"></script>
	<script src="/static/blog/coolblue/js/comment.js"></script>
	<script src="/static/blog/coolblue/js/jquery.fancybox.pack.js"></script>
	<script language="JavaScript">
		ajaxUrl = "/test_comment";

		var commentTips = {
			success: "<i class='icon-ok'></i>评论成功！",
			miss: "<i class='icon-exclamation-sign'></i>评论失败，请填写所有必填信息！",
			fail: "<i class='icon-exclamation-sign'></i>评论失败，请确保全部信息填写正确！",
			nochn: "<i class='icon-exclamation-sign'></i>评论失败，评论中必须包含中文！"
		}

		var wzt = encodeURIComponent(document.title);
		var wztb = escape(document.title);
		var wzu = encodeURIComponent(location.href);
		var wzub = escape(location.href);
		var title = document.title;
		var sc = location.href;

		function getSocialLink(s){
			switch(s){
				case "renren":
					return "http://share.renren.com/share/buttonshare.do?link="+wzu+"&title="+wzt;
				case "kaixin001":
					return "http://www.kaixin001.com/repaste/share.php?rurl="+wzu+"&rcontent="+wzu+"&rtitle="+wzt;
				case "qzone":
				    return "http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+wzu+"&title="+wzt;
				case "douban":
				    return "http://www.douban.com/recommend/?url="+wzu+"&title="+wzt;
				case "sina-weibo":
				    return "http://v.t.sina.com.cn/share/share.php?appkey=2233047537&ralateUid=1883113397&url="+wzu+"&title="+wzt;
				case "qq-weibo":
				    return "http://v.t.qq.com/share/share.php?appkey=a8eb5c5b39804bac8ef40d2babb55572&title="+wzt+'&url='+wzu;
				case "sohu-weibo":
				    return "http://t.sohu.com/third/post.jsp?&url="+wzu+"&title="+wztb;
				case "delicious":
					return "http://www.delicious.com/save?v=5&noui&jump=close&url="+wzu+'&title='+title;
				case "digg":
					return "http://digg.com/submit?url="+wzu+'&title='+title;
				case "google+":
				    return "https://plus.google.com/share?url="+wzu;
			}
		}

		$(function() {
			$("article.post div.primary p img").each(function(i){
				if($(this).parent("a").size() == 0){
					var imgSrc = $(this).attr("src");
					$(this).wrap("<a href='"+imgSrc+"' class='fancybox'></a>");
				}
			});
			$("div.share-box a").tooltip({
				placement: 'bottom'
			});
			$('.fancybox').fancybox({
				wrapCSS    : 'fancybox-custom',
				closeClick : true,

				helpers : {
					title : {
						type : 'inside'
					},
					overlay : {
						css : {
							'background-color' : '#eee'
						}
					}
				}
			});
		});
	</script>
    <style type="text/css">
        img.emotions-gif {background:white; border:none; padding:0;}
    </style>
</head>

<body id="top">
<!--header -->
<div id="header-wrap"><header>
{% include 'blog/header.html' %}

<!--/header-->
</header></div>


	<!-- content-wrap -->
	<div id="content-wrap">

	    <!-- content -->
	    <div id="content" class="clearfix">

			<!-- main -->
			<div id="main">

<!-- post -->
<article class="post single">

    <!-- primary -->
	<div class="primary" id="article-{{article.id}}">

	    <h2>
	    	<a href="#">{{ article.title }}</a>
		</h2>

        <p class="post-info"><span>位于分类</span> <a href="/blog/category/{{ article.category.id }}">{{ article.category.name }}</a></p>
        {{ article.content|safe }}

        <!--
		<div class="share-box clear" >
			<h4>分享到</h4>
	          <ul>
	          	<li><a title="分享到Google+" href="#" target="_blank" rel="nofollow" onclick="$(this).attr('href',getSocialLink('google+'));">
					<img alt="分享到Google+" src="/static/blog/coolblue/images/sns/32-google-plus.png" /></a>
				</li>
	          	<li><a title="分享到Delicious" href="#" target="_blank" rel="nofollow" onclick="$(this).attr('href',getSocialLink('delicious'));">
					<img alt="分享到Delicious" src="/static/blog/coolblue/images/sns/32-delicious.png" /></a>
				</li>
				<li><a title="分享到Digg" href="#" target="_blank" rel="nofollow" onclick="$(this).attr('href',getSocialLink('digg'));">
					<img alt="分享到Digg" src="/static/blog/coolblue/images/sns/32-digg.png" /></a>
				</li>
				<li><a title="分享到新浪微博" href="#" target="_blank" rel="nofollow" onclick="$(this).attr('href',getSocialLink('sina-weibo'));">
					<img alt="分享到新浪微博" src="/static/blog/coolblue/images/sns/32-weibo.png" /></a>
				</li>
				<li><a title="分享到腾讯微博" href="#" target="_blank" rel="nofollow" onclick="$(this).attr('href',getSocialLink('qq-weibo'));">
					<img alt="分享到腾讯微博" src="/static/blog/coolblue/images/sns/32-qqweibo.png" /></a>
				</li>
	            <li><a title="分享到人人网" href="#" target="_blank" rel="nofollow" onclick="$(this).attr('href',getSocialLink('renren'));">
					<img alt="分享到人人网" src="/static/blog/coolblue/images/sns/32-renren.png" /></a>
				</li>
				<li><a title="分享到豆瓣网" href="#" target="_blank" rel="nofollow" onclick="$(this).attr('href',getSocialLink('douban'));">
					<img alt="分享到豆瓣网" src="/static/blog/coolblue/images/sns/32-douban.png" /></a>
				</li>
				<li><a title="分享到开心网" href="#" target="_blank" rel="nofollow" onclick="$(this).attr('href',getSocialLink('kaixin001'));">
					<img alt="分享到开心网" src="/static/blog/coolblue/images/sns/32-kaixin001.png" /></a>
				</li>
	            <li><a title="分享到QQ空间" href="#" target="_blank" rel="nofollow" onclick="$(this).attr('href',getSocialLink('qzone'));">
					<img alt="分享到QQ空间" src="/static/blog/coolblue/images/sns/32-qzone.png" /></a>
				</li>
	            <li><a title="分享到搜狐微博" href="#" target="_blank" rel="nofollow" onclick="$(this).attr('href',getSocialLink('sohu-weibo'));">
					<img alt="分享到搜狐微博" src="/static/blog/coolblue/images/sns/32-sohuweibo.png" /></a>
				</li>
	          </ul>
			</div>
            -->

    <!-- /primary -->
    </div>


    <aside>

    	<p class="dateinfo">{{ article.created_time|timestr0|safe }}</p>

        <div class="post-meta">
       	    <h4>文章信息</h4>
            <ul>
          	    <li class="user"><a href="#" onclick="return false;">{{ g.user.name }}</a></li>
                <li class="time"><a href="#" onclick="return false;">{{ article.created_time|timestr1 }}</a></li>
                <li class="comment"><a href="#comments">{{ comments|length }}个评论</a></li>
                <li class="permalink"><a href="/blog/article/{{ article.id }}">持久连接</a></li>
            </ul>
        </div>

       <div class="post-meta">
            <h4>标签</h4>
			<ul class="tags">
                {% for tag in article.tags %}
	         	    <li><a href="/blog/tag/{{tag.id}}" rel="tag">{{ tag.name }}</a></li>
                {% endfor %}
	         </ul>
       </div>

    </aside>

<!-- /post -->
</article>


<!-- post-bottom-section -->
<div class="post-bottom-section" id="comments">

	<h4>{{ comments|length }}条留言</h4>

    <div class="primary">
    	<ol class="commentlist">
        {% for c in comments %}
            <li id="comment-{{c.id}}" class="depth-1">
		        <div class="comment-info">
			        <img alt="头像"
                      src="{% if c.avatar %}{{ c.avatar }}
                      {% else %}/static/blog/coolblue/images/gravatar.jpg{% endif %}"
                      class="avatar" height="40" width="40" />
					<cite>
						<a href="#comment-{{c.id}}" onclick="return false;">{{ c.username }}</a>
                        回复
                        {% if c.reply_to_comment %}
                        <a href="#comment-{{c.reply_to_comment.id}}">
                        @{{c.reply_to_comment.username}}</a>
                        {% else %}
                        <a href="#article-{{article.id}}">
                        @{{g.user.name}}</a>
                        {% endif %}
                        ： <br />
						<span class="comment-data"><a href="#comment-{{c.id}}" title="" onclick="return false;">{{ c.post_date|timestr2 }}</a></span>
					</cite>
				</div>
				<div class="comment-text">
					<p>{{ c.content }}</p>
					<div class="reply">
						<a rel="nofollow" class="comment-reply-link" href="#comment-{{c.id}}"
                        name="回复{{ c.username }}：">回复</a>
 					</div>
				</div>
		    </li>
        {% endfor %}
        <li id="end-of-comment"></li>
        <!-- /comment-list -->
		</ol>

    <!-- /primary -->
    </div>

 </div>


<div class="post-bottom-section">

    <h4>给作者留言</h4>

    <div class="primary">

    	<form action="/blog/new_comment" method="post" id="commentform">
			<input type="hidden" name="avatar" id="id_avatar" />
			<input type="hidden" name="reply_to_comment" id="id_reply_to_comment" />
			<input type="hidden" name="article" value="{{ article.id }}" id="id_article" />
       	    <div>
			    <label for="username">昵称 <span>*</span></label>
				<input onblur="inputFocusOrBlur(this, 1, &#39;你的昵称&#39;);" name="username" maxlength="50" onfocus="inputFocusOrBlur(this, 0, &#39;你的昵称&#39;);" type="text" id="name" value="你的昵称" tabindex="1" />
			</div>
            <div>
				<label for="email_address">电子邮箱（会为你保密） <span>*</span></label>
				<input onblur="inputFocusOrBlur(this, 1, &#39;你的邮箱&#39;);" name="email_address" maxlength="75" onfocus="inputFocusOrBlur(this, 0, &#39;你的邮箱&#39;);" type="text" id="email" value="你的邮箱" tabindex="2" />
			</div>
            <div>
				<label for="site">网址</label>
				<input onblur="inputFocusOrBlur(this, 1, &#39;你的网站&#39;);" name="site" maxlength="200" onfocus="inputFocusOrBlur(this, 0, &#39;你的网站&#39;);" type="text" id="website" value="你的网站" tabindex="3" />
			</div>
            <div>
				<label for="content">您的留言 <span>*</span></label>
				<textarea tabindex="4" rows="10" cols="18" name="content" id="message"></textarea>
			</div>
            <div class="no-border">
			    <input class="button" type="submit" value="提交评论" tabindex="5" />
			</div>

       </form>

    <!-- primary -->
    </div>
<!-- post-bottom-section -->
</div>



	<div id="subscribemodal" class="modal hide fade">
	<div class="modal-header" >
		<a class="close" data-dismiss="modal">×</a>
		<h3>邮件订阅请填写：</h3>
	</div>
	<div class="modal-body">
		<form action="/blog/subscriber/add/" method="post" id="subscribeform"><div style='display:none;'><input type='hidden'  name='csrfmiddlewaretoken' value='dd4ee8fe20a495ee90fa71fd042476c3' /></div>
			<div>
			    <label for="username">昵称 <span>*</span></label>
				<input onblur="inputFocusOrBlur(this, 1, &#39;你的昵称&#39;);" name="username" maxlength="50" onfocus="inputFocusOrBlur(this, 0, &#39;你的昵称&#39;);" type="text" id="name" value="你的昵称" />
			</div>
            <div>
				<label for="email_address">电子邮箱（会为你保密） <span>*</span></label>
				<input onblur="inputFocusOrBlur(this, 1, &#39;你的邮箱&#39;);" name="email_address" maxlength="75" onfocus="inputFocusOrBlur(this, 0, &#39;你的邮箱&#39;);" type="text" id="email" value="你的邮箱" />
			</div>
			<input class="button" type="submit" value="提交" />
		</form>
	</div>
</div>
				<div id="resultmodal" class="modal hide fade">
	<div class="modal-header" >
		<a class="close" data-dismiss="modal">×</a>
		<h3>需要提醒您：</h3>
	</div>
	<div class="modal-body">
		<p>评论成功</p>
	</div>
	<div class="modal-footer">
		<input class="button" type="button" value="确定" data-dismiss="modal"/>
	</div>
</div>
<!-- /main -->
</div>

<!-- sidebar -->
<div id="sidebar">
{% include 'blog/sidebar.html' %}
<!-- /sidebar -->
</div>

<!-- content -->
</div>

<!-- /content-out -->
</div>


<!-- extra -->
<div id="extra-wrap"><div id="extra" class="clearfix">
{% include 'blog/extra.html' %}
<!-- /extra -->
</div></div>

<!-- footer -->
<footer>
{% include 'blog/footer.html' %}
</footer>

{% include 'blog/js_after_footer.html' %}


</body>
